<template>
  <div>
      <h1>登录页</h1>

      <input type="text" v-model="username">
      <input type="text" v-model="password">
      <input type="button"  value="登录" @click="login">
      <a href="https://api.weibo.com/oauth2/authorize?client_id=2984443685&redirect_uri=http://127.0.0.1:8080/wb">微博登录</a>
  </div>
</template>

<script>
export default {
  data(){
    return {
      username:"",
      password:""
    }
  },
  methods:{
    login(){
      const data={
        "username":this.username,
        "password":this.password
      }
      this.axios.post("http://127.0.0.1:8000/login",data).then(resp=>{
        console.log(resp)
        alert(resp.data.msg)
      }).catch(error=>{
        console.log(error.response)
      })
    }
  }
}
</script>

<style>

</style>